/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller.commands;

import controller.BidirectionalHashMap;
import controller.Controller;
import java.io.PrintStream;
import java.io.Serializable;
import javax.swing.JOptionPane;
import model.codebehind.CodeModel;
import model.graphic.GraphicModel;
import view.GUI.graphic.GraphicView;

/**
 *
 * @author Administrator
 */
public abstract class BasicCommand implements Command, Serializable {

    protected GraphicView gview;
    protected GraphicModel gmodel;
    protected CodeModel cmodel;
    protected BidirectionalHashMap sync;
    protected Controller controller;

    protected void showPopup(String message, String title, int type) {
        JOptionPane.showMessageDialog(null, message, title, type);
    }

    protected void showPopup(PrintStream ps, String title, int type) {
        JOptionPane.showMessageDialog(null, ps, title, type);
    }

    @Override
    public void execute() {
    }

    public void setGModel(GraphicModel gmodel) {
        this.gmodel = gmodel;
    }

    public GraphicModel getGmodel() {
        return gmodel;
    }

    public void setCModel(CodeModel cmodel) {
        this.cmodel = cmodel;
    }

    /**
     * @return the cmodel
     */
    public CodeModel getCodeModel() {
        return cmodel;
    }

    /**
     * @return the sync
     */
    public BidirectionalHashMap getSync() {
        return sync;
    }

    /**
     * @param sync the sync to set
     */
    public void setSync(BidirectionalHashMap sync) {
        this.sync = sync;
    }

    /**
     * @param gview the gview to set
     */
    public void setGview(GraphicView gview) {
        this.gview = gview;
    }

    public GraphicView getGview() {
        return gview;
    }

    public void setController(Controller con) {
        this.controller = con;
    }
    
}